import styles from './EditList.module.scss';

type Props = {
  onClose: (value: string, prop: string) => void;
  value: string;
  prop: string;
  onValueSubmit: (value: string, prop: string) => void;
};

export const EditList = (props: Props) => {
  return (
    <div className={styles.root}>
      <div
        className="list-item"
        onClick={() => props.onValueSubmit('0', props.prop)}
      >
        {props.prop === 'gender' ? '男' : '拍照'}
      </div>
      <div
        className="list-item"
        onClick={() => props.onValueSubmit('1', props.prop)}
      >
        {props.prop === 'gender' ? '女' : '本地图片'}
      </div>
      <div
        className="list-item"
        onClick={() => props.onClose('cancel', props.prop)}
      >
        取消
      </div>
    </div>
  );
};
